// 获取select下拉列表数据
/**
 * 下拉共通
 * @param url 地址
 * @param param 传参
 * @param key
 * @param value
 * @returns {Promise<any>}
 * 
 */
export function getSelectData(method,url, param, key, value) {
  return new Promise((resolve, reject) => {
    this.axios[method](url, param).then((response) => {
      let result = response.data.map((item) => {
        let obj = {};
        obj[key] = item[key];
        obj[value] = item[value];
        return obj;
      });
      resolve(result);
    }).catch((error) => {
      reject(error);
    });
  });
}
export default {
  getSelectData
}